
****************************
*low/high  export intensity*
****************************
set more off
eststo clear
use temp1,clear
egen naf2yr = group(naf2 year)
global depvar "llaborpty"
global depvar_d1  "llaborpty_d1"
*low export intensity
eststo: xtreg  $depvar ltradeshock3 linv lmatraw i.naf2yr if expintens_quant==1, robust cluster(firmid) fe i(firmid)
eststo: reg 	$depvar_d1  ltradeshock6 linv_d1 lmatraw_d1 i.naf2yr if expintens_quant==1, robust cluster(firmid)
eststo: xtreg   $depvar_d1  ltradeshock6 linv_d1 lmatraw_d1 i.naf2yr if expintens_quant==1, robust cluster(firmid)  fe i(firmid)
*high export intensity
eststo: xtreg  $depvar ltradeshock3 linv lmatraw i.naf2yr if expintens_quant==4, robust cluster(firmid) fe i(firmid)
eststo: reg 	$depvar_d1  ltradeshock6 linv_d1 lmatraw_d1 i.naf2yr if expintens_quant==4, robust cluster(firmid)
eststo: xtreg   $depvar_d1  ltradeshock6 linv_d1 lmatraw_d1 i.naf2yr if expintens_quant==4, robust cluster(firmid)  fe i(firmid)
*
log using $DIRLOG/Replication/tab-ReducedFormIntens.txt, text replace
********************************************
*REDUCED FORM: low / high export intensity *
********************************************
esttab, keep(*shock* linv* lmatraw*) b(%4.3f) se(%4.3f) r2 starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01)  tex  title() label
esttab, keep(*shock* linv* lmatraw*) compress r2 starlevels(c 0.1 b 0.05 a 0.01)  b(%4.3f) se(%4.3f)
*output the results in a tex file directly inputable in the text
esttab using $DIRLOG/Replication/tab-ReducedFormIntens_input.tex, b(%4.3f) se(%4.3f)  starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01)    ///
nocons keep(*shock* linv* lmatraw*)  label tex substitute(\_ \_)  fragment replace nodepvars nonumbers nomtitles nogaps nolines eqlabels(none)
eststo clear
log close

